<template>
  <view>
    
   
    <view class="ptb">

      <view class="item plr" v-for="(item,index) in tablist" :key="index" v-if="tablist.length>0">
       
		<view class="flex pds20 rds5" style="background-color: #fff;">
		  <view class="cover">
		    <view class="fz16 bold">{{item.catname}}</view>
		  </view>
		  	<view class="fz12" style="color:#6F7492;" v-if="item.sum">{{item.sum}}{{$t('user.ben')}}</view>
		  <!-- <image :src="item.bookCover[0]" mode="aspectFill" style="height: 60rpx;width:50rpx ;">
		  </image> --> 
		</view>
        <view class="gridSm g2">
          <view class="item" @click="msg(item.subcategory,item,item.groupid,ind,item.tagcount)" v-for="(it,ind) in item.data" :key="ind">
              <view class="flex pd10 rds5" style="background-color: #EDEEFF;">
                <view class="cover">
                  <view class="fz16 bold">{{it.listname}}</view>
                </view>
                <!-- <image :src="item.bookCover[0]" mode="aspectFill" style="height: 60rpx;width:50rpx ;">
                </image> --> 
              </view>
          </view>
        </view> 
      
      </view>
    </view>
  </view>
</template> 
<script>
  import _list from '@/util/list.js';
   import _qdcat from '@/util/qidian.js';
 export default {
     data() {
       return {
         tablist:[]
       }
     },
     onShow() {
       // if(uni.getStorageSync('list_data')){
         
       //   this.tablist=uni.getStorageSync('list_data')
       // }
       this.getdata()
     },
     methods: {
       getdata() {
		   let _this=this
          _qdcat.getfemale().then((res) => {
			
           _this.data(res.data)
		 
          });
       },
	   data(data){
		    
		   _qdcat.GetString(data,'<ul class="sort-ul" data-l1="3">$</ul>').then((res) => {
		   			console.log('res',res)
					this.tablist=res
		   		 
		   });
		   
	   },
       msg(msg,data,id,index,tagcount){
        uni.setStorageSync('list_cat',msg);  
		uni.setStorageSync('list_tag',tagcount)
        uni.navigateTo({
        	url: '/pages/index/listitem?major='+msg.name+'&id='+id+'&index='+index
        });
       }
      
     }
   }
</script>
<style lang="scss">
  @import "common/css/base-view.scss";
page {
		background: #fff;
		color: #33363A;
	}
  .swiper-box {
    image {
      width: 100%;
      height: 300rpx;
    }
  }
  .bg{
   background-color: #FFFFFF;
   padding: 60rpx 20rpx 0rpx 20rpx;
   margin-bottom: 20px;
   border-radius: 10rpx;
  }
 
</style>
